package com.zmytest.annotation.scope.session;

import com.zmytest.annotation.scope.request.ScopeRequest;
import com.zmytest.annotation.scope.request.Service1;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.ObjectUtils;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * Created on 2018/12/29.
 *
 * @author zhangmingyu
 */
@RestController
@RequestMapping("/annotation/scope/session")
public class ScopeSessionController {

    @Autowired
    private ScopeSessionService scopeSessionService;
    @Autowired
    private ScopeSession scopeSession;

    @GetMapping("/test")
    public void test(String name){
        if (!ObjectUtils.isEmpty(name)) {
            scopeSession.setName(name);
        }
        scopeSessionService.test();
    }
}
